<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>
    <script>
    //   function Phone(name, price) {
    //     this.name = name
    //     this.price = price
    //   }
    //   Phone.prototype.call = function () {
    //     console.log("打电话")
    //   }
    //   let apple = new Phone("苹果", 5999)
    //   console.log(apple)
    class Phone {
        constructor(name,price){
            this.name = name
            this.price = price
        }
        call(){
            console.log("打电话");
        }
    }
    let apple = new Phone("苹果",5999)
    console.log(apple);
    </script>
  </body>
</html>
